from rest_framework.views import APIView
from rest_framework.viewsets import ModelViewSet

from apps.goods.models import SPU
from apps.meiduo_admin.serializers.sku import SPUListSerializer
from apps.meiduo_admin.serializers.spu import SPUModelSerializer
from apps.meiduo_admin.utils import PageNum


class SPUModelSerializerView(ModelViewSet):
    # 指定查询集
    queryset = SPU.objects.all()

    # 指定序列化器
    serializer_class = SPUModelSerializer

    # 指定分页
    pagination_class = PageNum